<template>
  <div>
    <DetailBanner :sightName = "sightName" :bannerImg = "bannerImg" :gallaryImgs = "gallaryImgs"></DetailBanner>
    <DetailHeader></DetailHeader>
    <DetailList :detailList = "detailList"></DetailList>
    <div class="test"></div>
  </div>
</template>

<script>
import DetailBanner from './components/Banner'
import DetailHeader from './components/Header'
import DetailList from './components/List'
import axios from 'axios'
export default {
  name: 'Detail',
  components: {
    DetailBanner,
    DetailHeader,
    DetailList
  },
  data () {
    return {
      sightName: '',
      bannerImg: '',
      gallaryImgs: [],
      detailList: [{
        title: '彩票一级',
        children: [{
          title: '彩票二级',
          children: [{
            title: '彩票三级'
          }]
        }, {
          title: '彩票二级2',
          children: [{
            title: '彩票三级2'
          }]
        }]
      }, {
        title: '彩票'
      }, {
        title: '彩票'
      }, {
        title: '彩票'
      }]
    }
  },
  mounted () {
    this.getDetailInfo()
  },
  methods: {
    getDetailInfo () {
      axios.get('/static/mook/detail.json', {
        params: {
          id: this.$route.params.id
        }
      }).then(this.getDetailInfoSucc)
    },
    getDetailInfoSucc (res) {
      res = res.data
      if (res.data && res.ret) {
        this.sightName = res.data.sightName
        this.bannerImg = res.data.bannerImg
        this.gallaryImgs = res.data.gallaryImgs
        this.detailList = res.data.categoryList
      }
    }
  }
}
</script>

<style lang="stylus" scoped>
  .test
    height: 30rem
</style>
